<?php
    class WZModel_Test_Book extends \WZ_Model
    {
        public $id_book;
        public $id_author;
        public $title;
        public $year;
        
        public function getAuthor()
        {
            if (null !== $this->id_author) {
                return \WZService_Test_Author::find($this->id_author);
            }
        }
        
        public function setAuthor(\WZModel_Test_Author $author)
        {
            if (null !== $author->getIdAuthor()) {
                return $this->setIdAuthor($author->getIdAuthor());
            }
        }
    }